import React from "react";
import store from "../../store";
import {Button} from "antd";

function Test(){

    let [num,SetNum] = React.useState({})

    num = store.getState().dashBoard

    const handleClick = ()=>{

        let action = {
            type:"NUM_ADD"
        }
        store.dispatch(action)

        console.log(num)
    }

    const update = ()=>{
        SetNum(store.getState().dashBoard)
    }

    store.subscribe(update.bind(this))

    return(
        <>
            Test Page
            <div>{num.n}</div>
            <Button onClick={handleClick}>Click</Button>
        </>
    )
}

export default Test